class CreateCampsites < ActiveRecord::Migration
  def self.up
    create_table :campsites do |t|
      t.string :camp_location
      t.decimal :capacity
      t.decimal :max_stay
      t.integer :walk_id, :null => false
      t.integer :fees_id, :null => false

      t.timestamps
    end
    execute "ALTER TABLE campsites ADD CONSTRAINT campsites_walks_FK
             FOREIGN KEY (walk_id) REFERENCES greatwalks(id)"
    execute "ALTER TABLE campsites ADD CONSTRAINT campsites_fees_FK
             FOREIGN KEY (fees_id) REFERENCES fees(id)"
  end

  def self.down
    drop_table :campsites
  end
end
